<template>
  <header class="fxs" :class="[type == 3 ? 'order':'']">
    <div class="info-bg info" v-if="type != 3">
      <span class="commission fontGilroy">
        <!-- <i>¥</i> -->
        {{Data.fenxiao_goods_count||0}}
      </span>
      <p>订货商品</p>
    </div>
    <div class="info-bg info2" v-else>
      <div class="commission fontGilroy">
        <span>
          <!-- <i>¥</i> -->
          {{Data.total_commissions}}
        </span>
        <p>我的{{Data.commission_name}}（元）</p>
      </div>
      <div class="other fontGilroy">
        <div>
          <span>{{Data.total_fee || 0}}</span>
          <p>{{Data.ftitle_fx_order}}总金额（元）</p>
        </div>
        <div>
          <span>{{Data.superior_user_payment || 0}}</span>
          <p>{{Data.ftitle_superior_user_order}}总金额（元）<span v-if="type == 3" @click="showTip(Data.ftitle_superior_user_order)">!</span></p>
        </div>
      </div>
    </div>
  </header>
</template>

<script>
import Vue from 'vue'
import { Dialog } from 'vant'
import Storage from '@/utils/store.js'
export default Vue.extend({
  props: {
    type: Number,
    Data: {
      type: Object
    }
  },
  methods: {
    selectNav(path,curtype) {
      // const pid = Storage.fetchLocal('pid')
      // const sid = Storage.fetchLocal('sid')
      // const query = { sid, pid }
      // this.$router.push({ path, query })
      if(curtype != this.type){
        this.$JumpPath(this,path)
      }
      //  
    },
    showTip(ftitleSuperiorUserOrder) {
      wx.showModal({
        title: ftitleSuperiorUserOrder + '总金额',
        content: '下级订单总金额：统计分销商直属下级的订单（如果开启分销内购，分销商自己下单，获得一级分销佣金，订单金额也会计算在内）',
        showCancel: false,//是否显示取消按钮
        confirmText: '关闭',//默认是“确定”
         confirmColor: '#f20b22',//确定文字的颜色
        success: (res) => {
          if (res.confirm) {
            // console.log('用户点击确定按钮')
          }
        }
      })
    }
  }
})
</script>

<style lang="scss">
@import 'src/styles/variables';
@import 'src/styles/mixin';
header {
  position: relative;
  width: 100%;
  .info-bg{    
    // height: 210px;
    text-align: center;
    margin: 0 auto;
    padding:56px 0;
    color: $default;
    background: url('https://img.wifenxiao.com/h5-wfx/images/user/fenxiaoGood_bg.png') center
      no-repeat;
    background-size: 100% 100%;
  }
  .info {
    p {
      margin-top: 14px;
      font-size: 26px;
      color:#FFD9DD;
    }
    span {
      display: block;
      font-size: 50px;
      i {
        font-size: 24px;
        margin-right: -10px;
      }
    }
  }
  .info2 {
    padding:46px 0;
    .commission {
      p {
        font-size: 26px;
        margin-top: 14px;
        color:#FFD9DD;
      }
      span {
        display: block;
        font-size: 50px;
      }
    }
    .other {
      margin-top: 40px;
      display: flex;
      justify-content: center;
      align-items: center;
      >div {
        flex: 1;
        padding: 0 20px;
        position: relative;
        &:first-child{
          &::before {
            content:"";
            position: absolute;
            bottom: 0;
            right: 0;
            width: 1px;
            height: 70px;
            background-color:#ff7c86;
          }
        }
        p {
          font-size: 24px;
          color: #ffdcd8;
          margin-top: 14px;
          span{
            display: inline-block;
            font-size: 24px;
            color: #fe224e;
            width: 34px;
            height: 34px;
            line-height: 34px;
            text-align: center;
            background: #ff8a91;
            border-radius: 50%;
          }
        }
        span {
          display: block;
          font-weight: bold;
          font-size: 36px;
        }
      }
    }
  }
  nav {
    // position: absolute;
    // left:0;
    // top:210px;
    // bottom: 0;
    // left: 50%;
    // transform: translate(-50%, 50%);
    width: 100%;
    height: 138px;
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    // overflow: hidden;
    .nav-item {
      flex: 1;
      height: 100%;
      position: relative;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;

      p {
        text-align: center;
        &.num {
          font-size: 32px;
          color: #F30C23;
          font-weight: bold;
        }
        &.name {
          font-size: 24px;
          color: #666;
          margin-top: 10px;
        }
      }
      &.active i {
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        height: 6px;
        width: 96px;
        @include gradient(right, rgba(242,11,34,1),rgba(242,11,34,0.1));
      }
      /* &::after {
        position: absolute;
        top: 50%;
        right: 0;
        width: 0;
        height: 30px;
        transform: translateY(-50%);
        content: '';
        border: 0.5px solid #e8e8e8;
      } */
      &:last-child {
        &::after {
          border: none;
        }
      }
    }
  }
 /*  &.order {
    height: 390px;
  } */
}
</style>
